﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;

namespace GenericModels
{
    [KnownType(typeof(List<Booking>))]
    [DataContract(IsReference = false)]
    public class Customer : Person
    {
        private int customerId;
        private List<Booking> bookings;

        public Customer()
        {
            customerId = 0;
            List<Booking> bookings = new List<Booking>();
        }

        public Customer(int cpr, string address, string phoneNo, string fName, string lName, string email, string cityName, int postalCode)
            : base(cpr, address, phoneNo, fName, lName, email, cityName, postalCode)
        {
            
            List<Booking> bookings = new List<Booking>();
        }

        #region getters and setters
        [DataMember]
        public int CustomerId
        {
            get { return customerId; }
            set { customerId = value; }
        }

        [DataMember]
        public List<Booking> Bookings
        {
            get { return bookings; }
            set { bookings = value; }
        }

        #endregion

        public void AddBooking(Booking bookingId)
        {
            bookings.Add(bookingId);
        }

        public void DeleteBooking(Booking bookingId)
        {
            bookings.Remove(bookingId);
        }

        

        public override void GetInfo()
        {
            base.GetInfo();
            Console.WriteLine("CustomerId: {0}", customerId);
        }
    }
}
